import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter);
const routes = [
    {
        path: '/home/:userId',
        name: 'home',
        component: ()=> import("../views/home.vue"),
        meta: {
            title: ''
        }
    }, 
    {
        path: '/nszc/:userId',
        name: 'nszc',
        component: ()=> import("../views/nszc.vue"),
        meta: {
            title: ''
        }
    }, 
    {
        path: '/jgzc/:userId',
        name: 'jgzc',
        component: ()=> import("../views/jgzc.vue"),
        meta: {
            title: ''
        }
    }, 
    {
        path: '/ggzc/:userId',
        name: 'ggzc',
        component: ()=> import("../views/ggzc.vue"),
        meta: {
            title: ''
        }
    }, 
    {
        path: '/dgdzc/:userId',
        name: 'dgdzc',
        component: ()=> import("../views/dgdzc.vue"),
        meta: {
            title: ''
        }
    }, 
    {
        path: '/gdrs/:userId',
        name: 'gdrs',
        component: ()=> import("../views/gdrs.vue"),
        meta: {
            title: ''
        }
    }, 
    {
        path: '/concern/:userId',
        name: 'concern',
        component: ()=> import("../views/concern.vue"),
        meta: {
            title: ''
        }
    }, 
];
const router = new VueRouter({
    linkActiveClass: 'active',
    base: process.env.BASE_URL,
    routes
});
//路由后置钩子
router.afterEach((to, from) => {

    //设置头部标题
    if (to.meta.title) document.title = to.meta.title;
});

export default router;